#include<iostream>
#include<vector>

using namespace std;
/*
ways(a,b) = ways(a-1,b) + ways(a,b-1)
*/
int ways(int width, int height) {
  int result = 0;
  if (width==1 || height==1) {
    return 1;
  }
  return ways(width-1, height) + ways(width, height-1);
}

int main(int argc, char const *argv[]) {
  for (int i = 1; i <= 20; ++i) {
    cout << "i = " << i <<endl;
    for (int j = 1; j <= 20; ++j) {
      cout << "j = " << j << ": " << ways(i,j) << "  ";
    }
    cout << endl;
  } 
  return 0;
}
